import {request} from './request';

export function login(rand, user) {
  // console.log(user);
  const u = new User(user)
  // console.log(u);
  return request({
    url: '/model/sysUser/login',
    method: "post",
    params: {
      rand
    },
    data:u
  });
}

export function list() {
  return request({
    url: '/model/sysUser/list',
    method: "get"
  });
}

export class User {
  constructor(itemInfo) {
    this.id = itemInfo.id;
    this.uname = itemInfo.username;
    this.pwd = itemInfo.password;
    this.phone = itemInfo.phone;
    this.email = itemInfo.email;
    this.sex = itemInfo.sex;
    this.birthday = itemInfo.birthday
    this.level = itemInfo.level
    this.creattime = itemInfo.creattime
    this.state = itemInfo.state
  }
}
